package com.banciyuan.bcywebview.biz.detail.goods;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.banciyuan.bcywebview.R;
import com.banciyuan.bcywebview.base.fragment.BaseLazyContainerFragment;
import com.banciyuan.bcywebview.utils.universalimageloader.core.ImageLoader;

/**
 * Created by squall on 2016/11/30.
 */

public class GoodsShellFragment extends BaseLazyContainerFragment {

    private ImageView bottom;
    private ImageView cover;
    private String cover_url;
    private String bottom_url;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View viewroot = inflater.inflate(R.layout.shells_item, null);
        initArgs();
        initUi(viewroot);
        return viewroot;
    }

    @Override
    protected void initArgs() {
        Bundle bundle = getArguments();
        cover_url = bundle.getString("cover_url");
        bottom_url = bundle.getString("bottom_url");
    }

    @Override
    protected void initUi(View rootview) {
        bottom = (ImageView) rootview.findViewById(R.id.item_bottom);
        cover = (ImageView) rootview.findViewById(R.id.item_cover);

        ImageLoader.getInstance().displayImage(bottom_url, bottom);
        ImageLoader.getInstance().displayImage(cover_url, cover);
    }
}
